<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html ng-app="LeaderboardApp">
<head>
<meta charset="UTF-8">
<title>Administracón de Metas Globales por Farmacia</title>
<link href="/Leaderboard/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/select2.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/select2-bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/styles.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/respond.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/jquery.spinner.min.js"></script>

<!--[if lt IE 9]><script type="text/javascript" src="/Leaderboard/js/lib/angularjs/html5shiv-printshiv.min.js"></script><![endif]-->
<!--[if lt IE 8]><script type="text/javascript" src="/Leaderboard/js/lib/angularjs/json3.min.js"></script><![endif]-->

<script type="text/javascript" src="/Leaderboard/js/lib/select2.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/angularjs/angularjs-1.2.16.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/controllers.init.js"></script>
<script type="text/javascript" src="/Leaderboard/js/controllers.admin.js"></script>
<script type="text/javascript"src="/Leaderboard/js/controllers.proyecciones.js"></script>

<!--[if lte IE 8]>
<script type="text/javascript">
    $(document).ready(function() {
        angular.bootstrap(document);
    });
</script>
<![endif]-->
</head>
<body>
	<div ng-include="'/Leaderboard/include/header.html'"></div>
	
	<div class="container">
		<div ng-include="'/Leaderboard/include/changePassword.html'"></div>
		
		<div ng-controller="proyeccionesCtrl" ng-init="setAdminPage(true); getMesesProyecciones();">
			<div ng-include="'/Leaderboard/include/messages.html'"></div>
			
			<div class="panel panel-primary">
				<div class="panel-heading">
					<h3 class="panel-title">Administraci&oacute;n de Metas Globales por Farmacia</h3>
				</div>
				<div class="panel-body panel-body-scrollable">
					<div class="span12 centered-pills">
						<ul class="nav nav-pills">
							<li ng-class="classForMes(mes)" ng-repeat="mes in mesesProyecciones"><a ng-click="setCurrentMes(mes); getProyeccionesAdministrar();" href="javascript:void(0);">{{mes.label}}</a></li>
						</ul>
					</div>
					
					<table id="tblProgresosGeneral" class="table table-striped table-condensed table-bordered" ng-table="tableParams">
						<thead><tr><th>Mes</th><th>Farmacia</th><th>Meta</th><th>D&iacute;as de Apertura</th></tr></thead>
						<tbody>
							<tr ng-repeat="proyeccion in proyeccionesAdministrar | filter:filterText">
								<td>{{proyeccion.mes}}</td>
								<td>{{proyeccion.branchId}} - {{proyeccion.branchName}}</td>
								<td>
									<span ng-hide="proyeccion.editable">{{proyeccion.meta}}</span>
									<span class="input-append spinner" data-trigger="spinner" ng-show="proyeccion.editable" >
										<input type="text" ng-model="proyeccion.meta" ng-disabled="loading" required class="form-control" maxlength="10" width="10" data-rule="currency" />
									</span>
								</td>
								<td>
									<span ng-hide="proyeccion.editable">{{proyeccion.diasApertura}}</span>
									<span class="input-append spinner" data-trigger="spinner" ng-show="proyeccion.editable" >
										<input type="text" ng-model="proyeccion.diasApertura" ng-disabled="loading" required class="form-control" maxlength="10" width="10" data-rule="currency" />
									</span>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="panel-footer">
					<input id="usrSearch" name="usrSearch" class="form-control search-box" ng-model="filterText" />
					<button type="button" class="btn btn-default" ng-click="getProyeccionesAdministrar();" >Refrescar</button>
					<button type="button" class="btn btn-primary" ng-click="guardarMetasProyecciones()" ng-disabled="loading">Guardar cambios</button>
				</div>
			</div>
	</div>
</body>
</html>